/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ClerkHomeViewPanel.java
 *
 * Created on Apr 29, 2010, 9:22:11 PM
 */

package ticketmaster.presentation.clerk;

import javax.swing.JToolBar;
import ticketmaster.presentation.customer.CustomerTicketsView;

/**
 *
 * @author Wei Liu
 */
public class ClerkHomeViewPanel extends ClerkBasePanel {

    /** Creates new form ClerkHomeViewPanel */
    public ClerkHomeViewPanel() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jSeparator1 = new javax.swing.JSeparator();
        pnlMain = new javax.swing.JPanel();
        jToolBar1 = new javax.swing.JToolBar(null, JToolBar.VERTICAL);
        btnBuy = new javax.swing.JButton();
        btnTickets = new javax.swing.JButton();

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(ticketmaster.TicketMasterApp.class).getContext().getResourceMap(ClerkHomeViewPanel.class);
        setBackground(resourceMap.getColor("Form.background")); // NOI18N
        setName("Form"); // NOI18N
        setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jSeparator1.setName("jSeparator1"); // NOI18N
        add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 0, 10, 620));

        pnlMain.setBackground(resourceMap.getColor("pnlMain.background")); // NOI18N
        pnlMain.setName("pnlMain"); // NOI18N

        javax.swing.GroupLayout pnlMainLayout = new javax.swing.GroupLayout(pnlMain);
        pnlMain.setLayout(pnlMainLayout);
        pnlMainLayout.setHorizontalGroup(
            pnlMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 890, Short.MAX_VALUE)
        );
        pnlMainLayout.setVerticalGroup(
            pnlMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 630, Short.MAX_VALUE)
        );

        add(pnlMain, new org.netbeans.lib.awtextra.AbsoluteConstraints(174, -4, 890, 630));

        jToolBar1.setBackground(resourceMap.getColor("jToolBar1.background")); // NOI18N
        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);
        jToolBar1.setName("jToolBar1"); // NOI18N

        btnBuy.setBackground(resourceMap.getColor("btnBuy.background")); // NOI18N
        btnBuy.setIcon(resourceMap.getIcon("btnBuy.icon")); // NOI18N
        btnBuy.setText(resourceMap.getString("btnBuy.text")); // NOI18N
        btnBuy.setFocusable(false);
        btnBuy.setName("btnBuy"); // NOI18N
        btnBuy.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnBuyActionPerformed(evt);
            }
        });
        jToolBar1.add(btnBuy);

        btnTickets.setBackground(resourceMap.getColor("btnTickets.background")); // NOI18N
        btnTickets.setIcon(resourceMap.getIcon("btnTickets.icon")); // NOI18N
        btnTickets.setText(resourceMap.getString("btnTickets.text")); // NOI18N
        btnTickets.setFocusable(false);
        btnTickets.setName("btnTickets"); // NOI18N
        btnTickets.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnTicketsActionPerformed(evt);
            }
        });
        jToolBar1.add(btnTickets);

        add(jToolBar1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 1, 160, 610));
    }// </editor-fold>//GEN-END:initComponents

    private void btnBuyActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnBuyActionPerformed
    {//GEN-HEADEREND:event_btnBuyActionPerformed
        ClerkSearchUserPanel csu = new ClerkSearchUserPanel();
        this.pnlMain.removeAll();
        this.pnlMain.add(csu);
        this.pnlMain.validate();
        this.pnlMain.repaint();
        csu.setPnlParent(pnlMain);
}//GEN-LAST:event_btnBuyActionPerformed

    private void btnTicketsActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnTicketsActionPerformed
    {//GEN-HEADEREND:event_btnTicketsActionPerformed
        CustomerTicketsView ctv = new CustomerTicketsView();
        this.pnlMain.removeAll();
        this.pnlMain.add(ctv);
        this.pnlMain.validate();
        this.pnlMain.repaint();
        ctv.setPnlParent(pnlMain);
}//GEN-LAST:event_btnTicketsActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnBuy;
    private javax.swing.JButton btnTickets;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JPanel pnlMain;
    // End of variables declaration//GEN-END:variables

}
